#ifndef CREATEOPERA_H
#define CREATEOPERA_H

#include <BScene>
#include "Opera.h"

class CreateOpera : public Opera
{
public:
	CreateOpera(BNode* node, BScene* scene)
	{
		_node = node;
		_scene = scene;
	}

	void setParent(BScene* scene)
	{
		_scene = scene;
	}
	BScene* parent() const
	{
		return _scene;
	}

	virtual BNode* node()
	{
		return _node;
	}
	virtual bool redo()
	{
		_scene->insert(_node);
		return true;
	}
	virtual bool undo()
	{
		_scene->remove(_node);
		return true;
	}

private:
	BHolder<BNode>		_node;
	BScene*				_scene;
};

#endif